import smCrypto from 'sm-crypto';

const publicKey = '04298364ec840088475eae92a591e01284d1abefcda348b47eb324bb521bb03b0b2a5bc393f6b71dabb8f15c99a0050818b56b23f31743b93df9cf8948f15ddb54';

enum SM2CipherMode {
    C1C2C3 = 0,
    C1C3C2 = 1,
}

export function sm2(msg: string, cipherMode: SM2CipherMode = SM2CipherMode.C1C3C2): string {
    return smCrypto.sm2.doEncrypt(msg, publicKey, cipherMode);
}
